#include "CscopeProcess.h"
#include "CscopePlugin.h"
#include <wx/txtstrm.h>

CscopeProcess::CscopeProcess(CscopePlugin* parent):
  wxProcess(parent) {
  wxASSERT(parent);
  m_parent = parent;
  Redirect();
}

CscopeProcess::~CscopeProcess() {
}
bool CscopeProcess::ReadProcessOutput() {
  if(IsInputAvailable()) {
    wxTextInputStream ts(*GetInputStream());
    wxString line = ts.ReadLine();
    if(line.Length())
      m_parent->OnProcessGeneratedOutputLine(line);
    return true;
  }
  return false;
}
